package demo7_i;

public class Test {
    public static void main(String[] args)
    throws CloneNotSupportedException{
        Person person1 = new Person("张三", 18);
        //clone, 返回类型为object，要进行向下转型
        Person person2 = (Person)person1.clone();
        System.out.println(person1.m.money);
        System.out.println(person2.m.money);
        person2.m.money = 100;
        System.out.println(person1.m.money);
        System.out.println(person2.m.money);
    }
}
